#include <iostream>
using namespace std;

const int N = 50010;
int p[N];

void doing() {
    for (int i = 2; i*i <= N; i++)
    {
        if (p[i] != 1)
        {
            for (int j = 2; i*j <= N; j++)
            {
                p[i*j] = 1; // 标记为不是素数
            }
        }
    }
}

int main() {
    int n;
    cin >> n;
    if (n < 2 || n > 50000)
    {
        return 0;
    }

    int count = 0;
    doing();

    for (int i = 2; i <= n; i++)
    {
        if (p[i] == 0)
        {
            count++;
        }
    }
    cout << count;

    return 0;
}